#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/11/10 19:34
# @Author  : zhaowp1109
# @File    : codes.py
# @Description :


class ResponseCode:
    '''
    返回值code信息
    '''
    SUCCESS = 200

    #用户相关接口
    class USER_CODES:
        NOT_FOUND=3000          #找不到对象
        FORBIDDEN = 3003        #禁止操作
        PASSWORD_ERROR = 3005   #密码错误

        EMAIL_EXIST = 3006    #email 已经存在
        USERNAME_EXIST = 3007  # email 已经存在

    #商品相关
    class GOODS_CODES:
        NOT_FOUND=4000

    #订单相关，包含购物车
    class ORDERS_CODES:
        NOT_FOUND=5000
        FORBIDDEN = 5003
        BUY_NUM_ERROR = 5004

    #支付相关
    class PAYMENT_CODES:
        NOT_FOUND = 6000
        FORBIDDEN = 6003

        PAYMENT_FAIL = 6005#创建支付失败


    #用户相关接口
    class CART_CODES:
        NOT_FOUND=5000          #找不到对象
        FORBIDDEN = 5003        #禁止操作

class ResponseMessage:
    '''
        code值
    '''
    MESSAGES={
        4000:'goods not exits'
    }
    @classmethod
    def get_message(cls,code,lan="zh_cn"):
        return cls.MESSAGES.get(code,'')


class EMAIL_TYPE:
    ACTIVE = "active"
    VERIFY = "verify"